import {Behaviour, HitTestScript} from "./gameengine";
import {marshal, MarshalDemoState, MarshalGateState, MarshalHallwayF1State} from "./marshal";

export class StartButtonBehaviour extends Behaviour{
    protected onStart() {
        const hitTest=this.displayObject.getScript(HitTestScript);
        hitTest.onClick=()=>{
            marshal.changeState(new MarshalGateState());
        }
    }

    protected onUpdate(advancedTime: number) {
    }

}

export class ReturnBehaviour extends Behaviour{
    protected onStart() {
        const hitTest=this.displayObject.getScript(HitTestScript);
        hitTest.onClick=()=>{
            marshal.changeState(new MarshalHallwayF1State());
        }
    }

    protected onUpdate(advancedTime: number) {
    }

}